package com.alibaba.citrus.cr.platform.enhance.facade.service.diff.common;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;

/**
 * @author: qiaojiange
 * @create: 2022/01/23
 * @Description LocalDateTime 转换成 Date
 */
public class LocalDateTime2DateUtils {

    /**
     * localDateTime 转换成 Data
     *
     * @param localDateTime localDateTime
     * @return date
     */
    public static Date parse(LocalDateTime localDateTime) {
        if (localDateTime == null) {
            return null;
        }
        return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
    }
}
